<?Lassoscript
// Last modified 4/17/09 by Eric Landmann

// FUNCTIONALITY
// This file processes action_params

// CHANGE NOTES
// 4/17/09
// Version 1.0

// Copying Action_Params to vars
// Remove leading and trailing spaces
// If required is missing, output an error
// If multiple errors, they will step on each other, but not worried about it

If: (Action_Param:'Error') != '';
	Var:'vError' = (Action_Param:'Error');
/If;
If: (Action_Param:'Option') != '';
	Var:'vOption' = (Action_Param:'Option');
/If;

// Pass a param "New" through the URL to indicate it is a new page
Var:'vNew' = (Action_Param:'New');
Var:'vProcess' = (Action_Param:'Process');

// Convert action_params
Var:'vID' = (Action_Param:'ID');
Var:'vSID' = (Action_Param:'SID');
Var:'vTID' = (Action_Param:'TID');
Var:'vName' = (Action_Param:'Name');
Var:'vAge' = (Action_Param:'Age');
Var:'vAddress' = (Action_Param:'Address');
Var:'vCity' = (Action_Param:'City');
Var:'vState' = (Action_Param:'State');
Var:'vEmail' = (Action_Param:'Email');
Var:'vPhone' = (Action_Param:'Phone');
Var:'vComment' = (Action_Param:'Comment');
Var:'vDisplay' = (Action_Param:'Display');
Var:'vDateCreated' = (Server_Date:-Extended);
Var:'vError'=(Action_Param:'Error');
Var:'vOption'=(Action_Param:'Option');

// If required is missing, output error 1001 "Required Missing"
// but ONLY if the page has been submit
If: (Response_Filepath) !>> 'consumer';
	If: $vNew != 'Y' && ((Response_Filepath) !>> 'setup_add' 
		|| (Response_Filepath) !>> 'setup_editrecord');
		If: ($vName == '') || ($vAddress == '') || ($vCity == '') || ($vState == '')|| ($vComment == '') || ($vDisplay == '');
			Var:'vError' = '1001';
			'<br>48: setting verror to 1001<br>';
		/If;
	/If;
/If;
?>